package ink.metoo.gude.handler

import ink.metoo.gude.util.logger
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertNotNull
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.cache.caffeine.CaffeineCacheManager
import org.springframework.cache.get


class UserRateLimiterAspectTest {

    val log = logger()

    @Test
    fun cacheNameTest() {
        val method = UserRateLimiterAspectTest::class.java.getDeclaredMethod("cacheNameTest")
        log.info(method.declaringClass.toString())
        log.info(method.toString())
    }

}

@SpringBootTest
class RateLimiterAspectSpringTest {

    @Autowired
    private lateinit var caffeineCacheManager: CaffeineCacheManager

    @Test
    fun testCase() {
        val cache = caffeineCacheManager["test"]
        assertNotNull(cache)
    }

}